package sourcecode;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author suxiaoxiao
 * @Date 2019/5/5 23:46
 * @Version 1.0
 */
public class ArrayTest {
    public static void main(String[] args) throws Exception {
//        List<string> list = new MyList();
        Class c = Class.forName("sourcecode.MyList");
        List<String> list = (List<String>) c.newInstance();
        Object[] objects = list.toArray();
        System.out.println(objects);
        System.out.println(objects.getClass());
    }
}

class MyList extends ArrayList<String> {

    @Override
    public String[] toArray() {
        return new String[]{"1", "2", "3"};
    }

}